package ui.panels;

import entities.User;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.border.EtchedBorder;
import ui.windows.RemedySchedulerFrame;

public class DoctorsPanel extends javax.swing.JPanel {

    /** Creates new form DoctorsPanel */
    public DoctorsPanel(RemedySchedulerFrame mainFrame) {
        initComponents();
        this.mainFrame = mainFrame;
        includeModel();
    }

    private void includeModel() {
        User user = mainFrame.getUser();
        lbDep.setText(user.getDepartmentName());
        if (user.getTitle() != null && user.getTitle().length() != 0) {
            lbName.setText(user.getTitle());
        } else {
            lbName.setText(user.getLoginID());
        }

        new Thread() {

            @Override
            public void run() {
                while (true) {
                    SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd h:mm a");
                    lbTime.setText(format.format(Calendar.getInstance().getTime()));
                    try {
                        sleep(1000);
                    } catch (InterruptedException ex) {
                        ex.printStackTrace();
                    }
                }
            }
        }.start();

        introductionPanel = new IntroductionPanel();
        schedulerPanel = new SchedulerPanel(mainFrame);
        viewSchedulerPanel = new ViewSchedulerInDep(mainFrame);
        editPatientMaterialPanel = new EditPatientReasonPanel(mainFrame);
        requestPanel = new EditShiftRequestPanel(mainFrame);
        holidayPanel = new ViewHolidayPanel(mainFrame);
        viewProfilePanel = new ViewProfilePanel(user);
        editProfilePanel = new EditProfilePanel(mainFrame);
        changePassPanel = new ChangePassPanel(mainFrame);
        showStartPage();
        timePanel = new TimePanel(mainFrame);
        timePanel.setBorder(new EtchedBorder());
        
        expandMenu1 = true;
        expandMenu2 = true;
        expandMenu3 = true;
        expandMenu4 = true;
    }

    private void switchTarget(int choise) {
        if (target != choise) {
            switch (target) {
                case 0:
                    break;
                case 1:
                    lbStartPageM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 2:
                    lbChagerSheetM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 3:
                    lbSchedulerInDepM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 4:
                    lbPatientM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 5:
                    lbShiftRequestM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 6:
                    lbGenRequest.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 7:
                    lbHolidayM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 8:
                    lbViewPM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 9:
                    lbEditPM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 10:
                    lbChangePassM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 11:
                    lbHelpM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
            }
            target = choise;
            this.remove(viewControl);
            this.repaint();
            switch (choise) {
                case 0:
                    currentPanel = introductionPanel;
                    break;
                case 1:
                    currentPanel = startPage;
                    lbStartPageM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 2:
                    currentPanel = schedulerPanel;
                    lbChagerSheetM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 3:
                    currentPanel = viewSchedulerPanel;
                    lbSchedulerInDepM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 4:
                    currentPanel = editPatientMaterialPanel;
                    lbPatientM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 5:
                    requestPanel.showAllRequest();
                    currentPanel = requestPanel;
                    lbShiftRequestM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 6:
                    requestPanel.showCreateShift();
                    currentPanel = requestPanel;
                    lbGenRequest.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 7:
                    currentPanel = holidayPanel;
                    lbHolidayM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 8:
                    currentPanel = viewProfilePanel;
                    lbViewPM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 9:
                    currentPanel = editProfilePanel;
                    lbEditPM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 10:
                    currentPanel = changePassPanel;
                    lbChangePassM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 11:
                    currentPanel = new JPanel();
                    lbHelpM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
            }
            viewControl = new JScrollPane(currentPanel);
            this.add(viewControl, BorderLayout.CENTER);
            this.revalidate();
        }
    }

    private void showIntroduction() {
        switchTarget(0);
    }

    private void showStartPage() {
        switchTarget(1);
    }

    private void showScheduler() {
        switchTarget(2);
    }
    
    private void showSchedulerInDep() {
        switchTarget(3);
    }
    
    private void showPatientMaterial() {
        switchTarget(4);
    }

    private void showShiftRequest() {
        switchTarget(5);
    }
    
    private void showGenRequest() {
        switchTarget(6);
    }

    private void showViewHoliday() {
        switchTarget(7);
    }

    private void showViewProfile() {
        switchTarget(8);
    }

    private void showEditProfile() {
        switchTarget(9);
    }

    private void showChangePass() {
        switchTarget(10);
    }

    private void showHelp() {
        switchTarget(11);
    }

    private void showHireControler() {
        if (showControler) {
            this.remove(viewMenu);
            lbOpenControl.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/expand2_15.gif")));
            showControler = false;
        } else {
            this.add(viewMenu, BorderLayout.WEST);
            lbOpenControl.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/expand1_15.gif")));
            showControler = true;
        }
        this.revalidate();
    }

    private void showHireTimer() {
        if (!showTimer) {
            this.add(timePanel, BorderLayout.EAST);
            lbOpenTimer.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/expand2_15.gif")));
            showTimer = true;
        } else {
            this.remove(timePanel);
            lbOpenTimer.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/expand1_15.gif")));
            showTimer = false;
        }
        this.revalidate();
    }
    
    private void expandMenu1() {
        if(expandMenu1) {
            new Thread() {
                @Override
                public void run() {
                    menu1.remove(lbPatientM);
                    menu1.repaint();
                    sleepTime(25);
                    menu1.remove(lbSchedulerInDepM);
                    menu1.repaint();
                    sleepTime(25);
                    menu1.remove(lbChagerSheetM);
                    menu1.repaint();
                    sleepTime(25);
                    menu1.remove(lbStartPageM);
                    menu1.repaint();
                    controller.revalidate();
                    lbSchedulerTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand-15.gif")));
                } 
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu1 = false;
        } else {
            new Thread() {
                @Override
                public void run() {
                    menu1.add(lbStartPageM);
                    menu1.revalidate();
                    sleepTime(25);
                    menu1.add(lbChagerSheetM);
                    menu1.revalidate();
                    sleepTime(25);
                    menu1.add(lbSchedulerInDepM);
                    menu1.revalidate();
                    sleepTime(25);
                    menu1.add(lbPatientM);
                    menu1.revalidate();
                    controller.revalidate();
                    lbSchedulerTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand1-15.gif")));
                } 
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu1 = true;
        }
    }
    
    private void expandMenu2() {
        if(expandMenu2) {
            new Thread() {
                @Override
                public void run() {
                    menu2.remove(lbHolidayM);
                    menu2.repaint();
                    sleepTime(25);
                    menu2.remove(lbGenRequest);
                    menu2.repaint();
                    sleepTime(25);
                    menu2.remove(lbShiftRequestM);
                    menu2.repaint();
                    controller.revalidate();
                    lbNoticeTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand-15.gif")));
                }    
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu2 = false;
        } else {
            new Thread() {
                @Override
                public void run() {
                    menu2.add(lbShiftRequestM);
                    menu2.revalidate();
                    sleepTime(25);
                    menu2.add(lbGenRequest);
                    menu2.revalidate();
                    sleepTime(25);
                    menu2.add(lbHolidayM);
                    menu2.revalidate();
                    controller.revalidate();
                    lbNoticeTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand1-15.gif")));
                }    
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu2 = true;
        }
    }
    
    private void expandMenu3() {
        if(expandMenu3) {
            new Thread() {
                @Override
                public void run() {
                    menu3.remove(lbChangePassM);
                    menu3.repaint();
                    sleepTime(25);
                    menu3.remove(lbEditPM);
                    menu3.repaint();
                    sleepTime(25);
                    menu3.remove(lbViewPM);
                    menu3.repaint();
                    controller.revalidate();
                    lbMyPTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand-15.gif")));
                }    
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu3 = false;
        } else {
            new Thread() {
                @Override
                public void run() {
                    menu3.add(lbViewPM);
                    menu3.revalidate();
                    sleepTime(25);
                    menu3.add(lbEditPM);
                    menu3.revalidate();
                    sleepTime(25);
                    menu3.add(lbChangePassM);
                    menu3.revalidate();
                    controller.revalidate();
                    lbMyPTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand1-15.gif")));
                }    
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu3 = true;
        }
    }
    
    private void expandMenu4() {
        if(expandMenu4) {
            new Thread() {
                @Override
                public void run() {
                    menu4.remove(lbHelpM);
                    menu4.repaint();
                    controller.revalidate();
                    lbOperationTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand-15.gif")));
                }  
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu4 = false;
        } else {
            new Thread() {
                @Override
                public void run() {
                    menu4.add(lbHelpM);
                    menu4.revalidate();
                    controller.revalidate();
                    lbOperationTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand1-15.gif")));
                }  
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu4 = true;
        }
    }

    private void logout() {
        boolean logout = mainFrame.logout();
        if (!logout) {
            JOptionPane.showMessageDialog(null, "Cannot logout", "Error", JOptionPane.WARNING_MESSAGE);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        header = new javax.swing.JPanel();
        lbHeader = new javax.swing.JLabel();
        lbDep = new javax.swing.JLabel();
        lbLogout = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        lbEditP = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        lbName = new javax.swing.JLabel();
        lbTime = new javax.swing.JLabel();
        bottomControl = new javax.swing.JPanel();
        lbOpenTimer = new javax.swing.JLabel();
        lbOpenControl = new javax.swing.JLabel();
        viewMenu = new javax.swing.JScrollPane();
        controller = new javax.swing.JPanel();
        lbSchedulerTab = new javax.swing.JLabel();
        menu1 = new javax.swing.JPanel();
        lbStartPageM = new javax.swing.JLabel();
        lbChagerSheetM = new javax.swing.JLabel();
        lbSchedulerInDepM = new javax.swing.JLabel();
        lbPatientM = new javax.swing.JLabel();
        lbNoticeTab = new javax.swing.JLabel();
        menu2 = new javax.swing.JPanel();
        lbShiftRequestM = new javax.swing.JLabel();
        lbGenRequest = new javax.swing.JLabel();
        lbHolidayM = new javax.swing.JLabel();
        lbMyPTab = new javax.swing.JLabel();
        menu3 = new javax.swing.JPanel();
        lbViewPM = new javax.swing.JLabel();
        lbEditPM = new javax.swing.JLabel();
        lbChangePassM = new javax.swing.JLabel();
        lbOperationTab = new javax.swing.JLabel();
        menu4 = new javax.swing.JPanel();
        lbHelpM = new javax.swing.JLabel();
        jPanel8 = new javax.swing.JPanel();
        viewControl = new javax.swing.JScrollPane();
        startPage = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();

        setLayout(new java.awt.BorderLayout());

        header.setBackground(new java.awt.Color(102, 0, 0));
        header.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        lbHeader.setFont(new java.awt.Font("Agency FB", 1, 24));
        lbHeader.setForeground(new java.awt.Color(255, 255, 51));
        lbHeader.setText("Remedy Scheduler");

        lbDep.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbDep.setForeground(new java.awt.Color(255, 255, 51));
        lbDep.setText("Depaertment");

        lbLogout.setForeground(new java.awt.Color(204, 255, 204));
        lbLogout.setText("Logout");
        lbLogout.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbLogoutMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbLogoutMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbLogoutMouseExited(evt);
            }
        });

        jLabel23.setForeground(new java.awt.Color(204, 255, 204));
        jLabel23.setText("|");

        lbEditP.setForeground(new java.awt.Color(204, 255, 204));
        lbEditP.setText("Edit Profile");
        lbEditP.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbEditPMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbEditPMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbEditPMouseExited(evt);
            }
        });

        jLabel25.setForeground(new java.awt.Color(204, 255, 204));
        jLabel25.setText("Hi");

        lbName.setFont(new java.awt.Font("Tahoma", 1, 11));
        lbName.setForeground(new java.awt.Color(204, 255, 204));
        lbName.setText("Name");
        lbName.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbNameMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbNameMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbNameMouseExited(evt);
            }
        });

        lbTime.setFont(new java.awt.Font("Tahoma", 1, 11));
        lbTime.setForeground(new java.awt.Color(204, 255, 204));
        lbTime.setText("Time");

        javax.swing.GroupLayout headerLayout = new javax.swing.GroupLayout(header);
        header.setLayout(headerLayout);
        headerLayout.setHorizontalGroup(
            headerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(headerLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(headerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(headerLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(lbDep)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 478, Short.MAX_VALUE)
                        .addComponent(jLabel25)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbName)
                        .addGap(120, 120, 120)
                        .addComponent(lbEditP)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel23)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbLogout))
                    .addGroup(headerLayout.createSequentialGroup()
                        .addComponent(lbHeader)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 664, Short.MAX_VALUE)
                        .addComponent(lbTime)))
                .addContainerGap())
        );
        headerLayout.setVerticalGroup(
            headerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(headerLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(headerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbHeader)
                    .addComponent(lbTime))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(headerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbDep)
                    .addComponent(lbLogout)
                    .addComponent(jLabel23)
                    .addComponent(lbEditP)
                    .addComponent(jLabel25)
                    .addComponent(lbName))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        add(header, java.awt.BorderLayout.PAGE_START);

        bottomControl.setBackground(new java.awt.Color(204, 255, 204));
        bottomControl.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        lbOpenTimer.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        lbOpenTimer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/expand1_15.gif"))); // NOI18N
        lbOpenTimer.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbOpenTimerMouseClicked(evt);
            }
        });

        lbOpenControl.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        lbOpenControl.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/expand1_15.gif"))); // NOI18N
        lbOpenControl.setToolTipText("expand");
        lbOpenControl.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbOpenControlMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout bottomControlLayout = new javax.swing.GroupLayout(bottomControl);
        bottomControl.setLayout(bottomControlLayout);
        bottomControlLayout.setHorizontalGroup(
            bottomControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, bottomControlLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbOpenControl)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 804, Short.MAX_VALUE)
                .addComponent(lbOpenTimer)
                .addContainerGap())
        );
        bottomControlLayout.setVerticalGroup(
            bottomControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bottomControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(lbOpenTimer)
                .addComponent(lbOpenControl))
        );

        add(bottomControl, java.awt.BorderLayout.PAGE_END);

        viewMenu.setPreferredSize(new java.awt.Dimension(180, 100));

        controller.setBackground(new java.awt.Color(153, 255, 255));
        controller.setPreferredSize(new java.awt.Dimension(160, 421));

        lbSchedulerTab.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbSchedulerTab.setForeground(new java.awt.Color(102, 102, 102));
        lbSchedulerTab.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/icon_expand1-15.gif"))); // NOI18N
        lbSchedulerTab.setText("Scheduler");
        lbSchedulerTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbSchedulerTabMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbSchedulerTabMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbSchedulerTabMouseExited(evt);
            }
        });

        menu1.setBackground(new java.awt.Color(153, 255, 255));
        menu1.setLayout(new java.awt.GridLayout(0, 1));

        lbStartPageM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbStartPageM.setText("Start page");
        lbStartPageM.setPreferredSize(new java.awt.Dimension(34, 25));
        lbStartPageM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbStartPageMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbStartPageMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbStartPageMMouseExited(evt);
            }
        });
        menu1.add(lbStartPageM);

        lbChagerSheetM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbChagerSheetM.setText("Chager sheet");
        lbChagerSheetM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbChagerSheetMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbChagerSheetMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbChagerSheetMMouseExited(evt);
            }
        });
        menu1.add(lbChagerSheetM);

        lbSchedulerInDepM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbSchedulerInDepM.setText("View Scheduler of Department");
        lbSchedulerInDepM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbSchedulerInDepMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbSchedulerInDepMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbSchedulerInDepMMouseExited(evt);
            }
        });
        menu1.add(lbSchedulerInDepM);

        lbPatientM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbPatientM.setText("Patient's material");
        lbPatientM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbPatientMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbPatientMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbPatientMMouseExited(evt);
            }
        });
        menu1.add(lbPatientM);

        lbNoticeTab.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbNoticeTab.setForeground(new java.awt.Color(102, 102, 102));
        lbNoticeTab.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/icon_expand1-15.gif"))); // NOI18N
        lbNoticeTab.setText("Notice");
        lbNoticeTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbNoticeTabMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbNoticeTabMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbNoticeTabMouseExited(evt);
            }
        });

        menu2.setBackground(new java.awt.Color(153, 255, 255));
        menu2.setLayout(new java.awt.GridLayout(0, 1));

        lbShiftRequestM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbShiftRequestM.setText("Shift request");
        lbShiftRequestM.setPreferredSize(new java.awt.Dimension(34, 25));
        lbShiftRequestM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbShiftRequestMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbShiftRequestMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbShiftRequestMMouseExited(evt);
            }
        });
        menu2.add(lbShiftRequestM);

        lbGenRequest.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbGenRequest.setText("Generate shift request");
        lbGenRequest.setPreferredSize(new java.awt.Dimension(34, 25));
        lbGenRequest.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbGenRequestMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbGenRequestMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbGenRequestMouseExited(evt);
            }
        });
        menu2.add(lbGenRequest);

        lbHolidayM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbHolidayM.setText("Holiday");
        lbHolidayM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbHolidayMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbHolidayMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbHolidayMMouseExited(evt);
            }
        });
        menu2.add(lbHolidayM);

        lbMyPTab.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbMyPTab.setForeground(new java.awt.Color(102, 102, 102));
        lbMyPTab.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/icon_expand1-15.gif"))); // NOI18N
        lbMyPTab.setText("My Profile");
        lbMyPTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbMyPTabMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbMyPTabMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbMyPTabMouseExited(evt);
            }
        });

        menu3.setBackground(new java.awt.Color(153, 255, 255));
        menu3.setLayout(new java.awt.GridLayout(0, 1));

        lbViewPM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbViewPM.setText("View profile");
        lbViewPM.setPreferredSize(new java.awt.Dimension(40, 25));
        lbViewPM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbViewPMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbViewPMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbViewPMMouseExited(evt);
            }
        });
        menu3.add(lbViewPM);

        lbEditPM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbEditPM.setText("Edit profile");
        lbEditPM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbEditPMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbEditPMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbEditPMMouseExited(evt);
            }
        });
        menu3.add(lbEditPM);

        lbChangePassM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbChangePassM.setText("Change password");
        lbChangePassM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbChangePassMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbChangePassMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbChangePassMMouseExited(evt);
            }
        });
        menu3.add(lbChangePassM);

        lbOperationTab.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbOperationTab.setForeground(new java.awt.Color(102, 102, 102));
        lbOperationTab.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/icon_expand1-15.gif"))); // NOI18N
        lbOperationTab.setText("Operations");
        lbOperationTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbOperationTabMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbOperationTabMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbOperationTabMouseExited(evt);
            }
        });

        menu4.setBackground(new java.awt.Color(153, 255, 255));
        menu4.setLayout(new java.awt.GridLayout(0, 1));

        lbHelpM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbHelpM.setText("Help");
        lbHelpM.setPreferredSize(new java.awt.Dimension(40, 25));
        lbHelpM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbHelpMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbHelpMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbHelpMMouseExited(evt);
            }
        });
        menu4.add(lbHelpM);

        jPanel8.setBackground(new java.awt.Color(153, 255, 255));
        jPanel8.setLayout(new java.awt.GridLayout(0, 1));

        javax.swing.GroupLayout controllerLayout = new javax.swing.GroupLayout(controller);
        controller.setLayout(controllerLayout);
        controllerLayout.setHorizontalGroup(
            controllerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(controllerLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbSchedulerTab)
                .addContainerGap(89, Short.MAX_VALUE))
            .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
            .addComponent(menu1, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
            .addGroup(controllerLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbNoticeTab)
                .addContainerGap(111, Short.MAX_VALUE))
            .addComponent(menu2, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
            .addGroup(controllerLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbMyPTab)
                .addContainerGap(88, Short.MAX_VALUE))
            .addComponent(menu3, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
            .addGroup(controllerLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbOperationTab)
                .addContainerGap(82, Short.MAX_VALUE))
            .addComponent(menu4, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
        );
        controllerLayout.setVerticalGroup(
            controllerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(controllerLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbSchedulerTab)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(menu1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lbNoticeTab)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(menu2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lbMyPTab)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(menu3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lbOperationTab)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(menu4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(57, 57, 57)
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(57, Short.MAX_VALUE))
        );

        viewMenu.setViewportView(controller);

        add(viewMenu, java.awt.BorderLayout.LINE_START);

        startPage.setBackground(new java.awt.Color(255, 255, 255));

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel2.setForeground(new java.awt.Color(51, 51, 51));
        jLabel2.setText("Operations:");

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/schedulerIcon.gif"))); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/patient-50.png"))); // NOI18N
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/request.png"))); // NOI18N
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/calendar-50.png"))); // NOI18N
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel3.setForeground(new java.awt.Color(102, 102, 102));
        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel3.setText("scheduler");

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel4.setForeground(new java.awt.Color(102, 102, 102));
        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel4.setText("patients");

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel5.setForeground(new java.awt.Color(102, 102, 102));
        jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel5.setText("request");

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 10));
        jLabel6.setForeground(new java.awt.Color(102, 102, 102));
        jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel6.setText("holiday");

        javax.swing.GroupLayout startPageLayout = new javax.swing.GroupLayout(startPage);
        startPage.setLayout(startPageLayout);
        startPageLayout.setHorizontalGroup(
            startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(startPageLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addGroup(startPageLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap(276, Short.MAX_VALUE))
        );
        startPageLayout.setVerticalGroup(
            startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(startPageLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton4)
                    .addComponent(jButton3)
                    .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jLabel4)
                    .addComponent(jLabel5)
                    .addComponent(jLabel6))
                .addContainerGap(404, Short.MAX_VALUE))
        );

        viewControl.setViewportView(startPage);

        add(viewControl, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

private void lbSchedulerTabMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbSchedulerTabMouseClicked
    expandMenu1();
}//GEN-LAST:event_lbSchedulerTabMouseClicked

private void lbSchedulerTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbSchedulerTabMouseEntered
    lbSchedulerTab.setForeground(Color.black);
}//GEN-LAST:event_lbSchedulerTabMouseEntered

private void lbSchedulerTabMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbSchedulerTabMouseExited
    lbSchedulerTab.setForeground(new Color(102, 102, 102));
}//GEN-LAST:event_lbSchedulerTabMouseExited

private void lbNoticeTabMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbNoticeTabMouseClicked
    expandMenu2();
}//GEN-LAST:event_lbNoticeTabMouseClicked

private void lbNoticeTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbNoticeTabMouseEntered
    lbNoticeTab.setForeground(Color.black);
}//GEN-LAST:event_lbNoticeTabMouseEntered

private void lbNoticeTabMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbNoticeTabMouseExited
    lbNoticeTab.setForeground(new Color(102, 102, 102));
}//GEN-LAST:event_lbNoticeTabMouseExited

private void lbMyPTabMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbMyPTabMouseClicked
    expandMenu3();
}//GEN-LAST:event_lbMyPTabMouseClicked

private void lbMyPTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbMyPTabMouseEntered
    lbMyPTab.setForeground(Color.black);
}//GEN-LAST:event_lbMyPTabMouseEntered

private void lbMyPTabMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbMyPTabMouseExited
    lbMyPTab.setForeground(new Color(102, 102, 102));
}//GEN-LAST:event_lbMyPTabMouseExited

private void lbOperationTabMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOperationTabMouseClicked
    expandMenu4();
}//GEN-LAST:event_lbOperationTabMouseClicked

private void lbOperationTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOperationTabMouseEntered
    lbOperationTab.setForeground(Color.black);
}//GEN-LAST:event_lbOperationTabMouseEntered

private void lbOperationTabMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOperationTabMouseExited
    lbOperationTab.setForeground(new Color(102, 102, 102));
}//GEN-LAST:event_lbOperationTabMouseExited

private void lbStartPageMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbStartPageMMouseClicked
    showStartPage();
}//GEN-LAST:event_lbStartPageMMouseClicked

private void lbStartPageMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbStartPageMMouseEntered
    lbStartPageM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbStartPageMMouseEntered

private void lbStartPageMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbStartPageMMouseExited
    lbStartPageM.setBorder(null);
}//GEN-LAST:event_lbStartPageMMouseExited

private void lbChagerSheetMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbChagerSheetMMouseClicked
    showScheduler();
}//GEN-LAST:event_lbChagerSheetMMouseClicked

private void lbChagerSheetMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbChagerSheetMMouseEntered
    lbChagerSheetM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbChagerSheetMMouseEntered

private void lbChagerSheetMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbChagerSheetMMouseExited
    lbChagerSheetM.setBorder(null);
}//GEN-LAST:event_lbChagerSheetMMouseExited

private void lbShiftRequestMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbShiftRequestMMouseClicked
    showShiftRequest();
}//GEN-LAST:event_lbShiftRequestMMouseClicked

private void lbShiftRequestMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbShiftRequestMMouseEntered
    lbShiftRequestM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbShiftRequestMMouseEntered

private void lbShiftRequestMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbShiftRequestMMouseExited
    lbShiftRequestM.setBorder(null);
}//GEN-LAST:event_lbShiftRequestMMouseExited

private void lbHolidayMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHolidayMMouseClicked
    showViewHoliday();
}//GEN-LAST:event_lbHolidayMMouseClicked

private void lbHolidayMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHolidayMMouseEntered
    lbHolidayM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbHolidayMMouseEntered

private void lbHolidayMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHolidayMMouseExited
    lbHolidayM.setBorder(null);
}//GEN-LAST:event_lbHolidayMMouseExited

private void lbViewPMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbViewPMMouseClicked
    showViewProfile();
}//GEN-LAST:event_lbViewPMMouseClicked

private void lbViewPMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbViewPMMouseEntered
    lbViewPM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbViewPMMouseEntered

private void lbViewPMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbViewPMMouseExited
    lbViewPM.setBorder(null);
}//GEN-LAST:event_lbViewPMMouseExited

private void lbEditPMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMMouseClicked
    showEditProfile();
}//GEN-LAST:event_lbEditPMMouseClicked

private void lbEditPMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMMouseEntered
    lbEditPM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbEditPMMouseEntered

private void lbEditPMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMMouseExited
    lbEditPM.setBorder(null);
}//GEN-LAST:event_lbEditPMMouseExited

private void lbChangePassMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbChangePassMMouseClicked
    showChangePass();
}//GEN-LAST:event_lbChangePassMMouseClicked

private void lbChangePassMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbChangePassMMouseEntered
    lbChangePassM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbChangePassMMouseEntered

private void lbChangePassMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbChangePassMMouseExited
    lbChangePassM.setBorder(null);
}//GEN-LAST:event_lbChangePassMMouseExited

private void lbHelpMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHelpMMouseClicked
    showHelp();
}//GEN-LAST:event_lbHelpMMouseClicked

private void lbHelpMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHelpMMouseEntered
    lbHelpM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbHelpMMouseEntered

private void lbHelpMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHelpMMouseExited
    lbHelpM.setBorder(null);
}//GEN-LAST:event_lbHelpMMouseExited

private void lbOpenControlMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOpenControlMouseClicked
    showHireControler();
}//GEN-LAST:event_lbOpenControlMouseClicked

private void lbNameMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbNameMouseClicked
    showViewProfile();
}//GEN-LAST:event_lbNameMouseClicked

private void lbNameMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbNameMouseEntered
    lbName.setForeground(new Color(255, 255, 51));
}//GEN-LAST:event_lbNameMouseEntered

private void lbNameMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbNameMouseExited
    lbName.setForeground(new Color(204, 255, 204));
}//GEN-LAST:event_lbNameMouseExited

private void lbEditPMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMouseClicked
    showEditProfile();
}//GEN-LAST:event_lbEditPMouseClicked

private void lbEditPMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMouseEntered
    lbEditP.setForeground(new Color(255, 255, 51));
}//GEN-LAST:event_lbEditPMouseEntered

private void lbEditPMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMouseExited
    lbEditP.setForeground(new Color(204, 255, 204));
}//GEN-LAST:event_lbEditPMouseExited

private void lbLogoutMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbLogoutMouseClicked
    logout();
}//GEN-LAST:event_lbLogoutMouseClicked

private void lbLogoutMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbLogoutMouseEntered
    lbLogout.setForeground(new Color(255, 255, 51));
}//GEN-LAST:event_lbLogoutMouseEntered

private void lbLogoutMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbLogoutMouseExited
    lbLogout.setForeground(new Color(204, 255, 204));
}//GEN-LAST:event_lbLogoutMouseExited

private void lbOpenTimerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOpenTimerMouseClicked
    showHireTimer();
}//GEN-LAST:event_lbOpenTimerMouseClicked

private void lbGenRequestMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbGenRequestMouseClicked
    showGenRequest();
}//GEN-LAST:event_lbGenRequestMouseClicked

private void lbGenRequestMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbGenRequestMouseEntered
    lbGenRequest.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbGenRequestMouseEntered

private void lbGenRequestMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbGenRequestMouseExited
    lbGenRequest.setBorder(null);
}//GEN-LAST:event_lbGenRequestMouseExited

private void lbSchedulerInDepMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbSchedulerInDepMMouseClicked
    showSchedulerInDep();
}//GEN-LAST:event_lbSchedulerInDepMMouseClicked

private void lbSchedulerInDepMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbSchedulerInDepMMouseEntered
    lbSchedulerInDepM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbSchedulerInDepMMouseEntered

private void lbSchedulerInDepMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbSchedulerInDepMMouseExited
    lbSchedulerInDepM.setBorder(null);
}//GEN-LAST:event_lbSchedulerInDepMMouseExited

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    showScheduler();
}//GEN-LAST:event_jButton1ActionPerformed

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
    showShiftRequest();
}//GEN-LAST:event_jButton3ActionPerformed

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
    showViewHoliday();
}//GEN-LAST:event_jButton4ActionPerformed

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
    showPatientMaterial();
}//GEN-LAST:event_jButton2ActionPerformed

private void lbPatientMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbPatientMMouseClicked
    showPatientMaterial();
}//GEN-LAST:event_lbPatientMMouseClicked

private void lbPatientMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbPatientMMouseEntered
    lbPatientM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbPatientMMouseEntered

private void lbPatientMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbPatientMMouseExited
    lbPatientM.setBorder(null);
}//GEN-LAST:event_lbPatientMMouseExited
    private RemedySchedulerFrame mainFrame;
    private IntroductionPanel introductionPanel;
    private SchedulerPanel schedulerPanel;
    private ViewSchedulerInDep viewSchedulerPanel;
    private EditPatientReasonPanel editPatientMaterialPanel;
    private EditShiftRequestPanel requestPanel;
    private ViewHolidayPanel holidayPanel;
    private ViewProfilePanel viewProfilePanel;
    private EditProfilePanel editProfilePanel;
    private ChangePassPanel changePassPanel;
    private JPanel currentPanel;
    private TimePanel timePanel;
    private boolean showControler = true;
    private boolean showTimer = false;
    private int target;
    private boolean expandMenu1, expandMenu2, expandMenu3, expandMenu4;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel bottomControl;
    private javax.swing.JPanel controller;
    private javax.swing.JPanel header;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JLabel lbChagerSheetM;
    private javax.swing.JLabel lbChangePassM;
    private javax.swing.JLabel lbDep;
    private javax.swing.JLabel lbEditP;
    private javax.swing.JLabel lbEditPM;
    private javax.swing.JLabel lbGenRequest;
    private javax.swing.JLabel lbHeader;
    private javax.swing.JLabel lbHelpM;
    private javax.swing.JLabel lbHolidayM;
    private javax.swing.JLabel lbLogout;
    private javax.swing.JLabel lbMyPTab;
    private javax.swing.JLabel lbName;
    private javax.swing.JLabel lbNoticeTab;
    private javax.swing.JLabel lbOpenControl;
    private javax.swing.JLabel lbOpenTimer;
    private javax.swing.JLabel lbOperationTab;
    private javax.swing.JLabel lbPatientM;
    private javax.swing.JLabel lbSchedulerInDepM;
    private javax.swing.JLabel lbSchedulerTab;
    private javax.swing.JLabel lbShiftRequestM;
    private javax.swing.JLabel lbStartPageM;
    private javax.swing.JLabel lbTime;
    private javax.swing.JLabel lbViewPM;
    private javax.swing.JPanel menu1;
    private javax.swing.JPanel menu2;
    private javax.swing.JPanel menu3;
    private javax.swing.JPanel menu4;
    private javax.swing.JPanel startPage;
    private javax.swing.JScrollPane viewControl;
    private javax.swing.JScrollPane viewMenu;
    // End of variables declaration//GEN-END:variables
}
